import request from '@/utils/request'

//前后端，对接接口

export function listBrand(query){
    return request({
        url: '/product/brand/list',
        method: 'get',
        params: query   //  params传参，就是在url后以问号的key=value的格式传递。
        //data: query  //  data属性表示参数存放到请求体中传递。请求方法，post,put
    });
}


export function addBrand(data){
    return request({
        url: '/product/brand',
        method: 'post',
        data //属性简写
    });
}


export function getBrand(id){
    return request({
        url: `/product/brand/${id}`,
        method: 'get'
    });
}
export function updateBrand(data){
    return request({
        url: '/product/brand',
        method: 'put',
        data //属性简写
    });
}




export function deleteBrand(id){
    return request({
        url: `/product/brand/${id}`,
        method: 'delete'
    });
}


export function getBrandAll(){
    return request({
        url: `/product/brand/getBrandAll`,
        method: 'get'
    });
}